#导包
import pymysql
#连接数据库
db = pymysql.connect(
    host='localhost',
    port=3306,
    user='root',
    password='1234',
    database='company',
    charset='utf8'
)
#创建游标
cursor = db.cursor()
#准备要执行的SQL语句

for i in range(0,10):
    name = input(f"请输入第{i+1}个人的姓名")
    age = input(f"请输入第{i+1}个人的年龄")
    sex = input(f"请输入第{i+1}个人的性别")
    height = input(f"请输入第{i+1}个人的身高")
    values = (name,age,sex,height)
    sql = "insert into person  values{}".format(values)
    cursor.execute(sql)
    db.commit()
# 关闭游标
cursor.close()
# 关闭连接
db.close()